package com.zjz.studynotes.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Upsert;

import com.zjz.studynotes.bean.LoginUserInfo;
import com.zjz.studynotes.bean.StudyNoteInfo;

import java.util.List;

/**
 * Description:
 * Author: zjz
 * Date:2025/5/5 13:37
 */
@Dao
public interface StudyNoteInfoDao {

    @Upsert
    void insert(StudyNoteInfo... infos);

    @Query("SELECT * FROM StudyNoteInfo")
    List<StudyNoteInfo> queryAll();

    @Query("SELECT * FROM StudyNoteInfo where title like :key or content like :key")
    List<StudyNoteInfo> queryInfoByKey(String key);

    @Query("SELECT * FROM StudyNoteInfo WHERE id =:sid")
    StudyNoteInfo queryInfoByID(int sid);
    @Delete
    void deleteNote(StudyNoteInfo info);
}
